//
//  ProjectListCell.swift
//  HuaYun
//
//  Created by enghou on 2018/7/31.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

import UIKit

class ProjectListCell: UITableViewCell {

    
    
    @IBOutlet weak var projectNameLabel: UILabel!
    
    @IBOutlet weak var belongingDepartmentLbl: UILabel!
    
    @IBOutlet weak var projectManagerLabel: UILabel!
//    @IBOutlet weak var dateLabel: UIView!
    @IBOutlet weak var dateLabel: UILabel!
    
    var model: JSON? {
        set{
            if ((newValue?.contents?.keys)?.contains("gsProjName"))! {
                self.projectNameLabel.text = newValue?.contents?["gsProjName"]?.rawString()
                
                self.belongingDepartmentLbl.text = newValue?.contents?["applyDept"]?.rawString()
                
                self.dateLabel.text = newValue?.contents?["setDate"]?.rawString()
                
                self.projectManagerLabel.text = newValue?.contents?["projManagerName"]?.rawString()
            } else if ((newValue?.contents?.keys)?.contains("projectName"))! {
                self.projectNameLabel.text = newValue?.contents?["projectName"]?.rawString()
                
                self.belongingDepartmentLbl.text = newValue?.contents?["deptName"]?.rawString()
                
                self.projectManagerLabel.text = newValue?.contents?["employeeName"]?.rawString()
                self.dateLabel.isHidden = true
            } else if (newValue?["serialNumber"].string?.count ?? 0) > 0 {
                self.projectNameLabel.text = newValue?["serialNumber"].string
                self.belongingDepartmentLbl.text = newValue?["applyDept"].string
                self.dateLabel.text = newValue?["applyTime"].string
                self.projectManagerLabel.text = newValue?["applyUser"].string
            }
            
            
        }
        get{
            return nil
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
